package com.apes.fico.masterdata.gl.respository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.fico.masterdata.gl.model.AccountingOperatingChartAuxiliary;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AccountingOperatingChartAuxiliaryRepository extends CustomRepository<AccountingOperatingChartAuxiliary,String> {
    @Query(value = " select new map(s.id as id, p.name as name,p.api as api,p.id as project_id,p.name as auxName,p.valueFormatter as valueFormatter,p.domain as domain) "+
                   " from AccountingOperatingChartAuxiliary s left join s.accAuxiliaryProject p" +
                   " where s.accOperatingChart.id = ?1 ORDER BY s.sequence")
    List<AccountingOperatingChartAuxiliary> findByAccOperatingChartId(String id);
}
